package com.itump.base.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
 * 标题: 日志信息<br>
 * 作者: 马寒<br>
 * 功能描述: 日志管理model<br>
 * 创建时间: 2011年10月17日, PM 02:51:02<br>
 * 版本信息: 1.0<br>
 * Copyright: Copyright (c) 2011<br>
 */
@Entity
@Table(name = "FP_W_LOG")
@XmlRootElement(name="LOG")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class Log implements Serializable {
	private static final long serialVersionUID = -3850351958294988188L;
	public Log() {
	}
	@Id
	@Column(name = "LOG_ID", length = 36, nullable = false)
	private String logId;// 日志编号
	@Column(name = "APPLICATION_ID", length = 36)
	private String applicationId;// 应用程序ID
	@Column(name = "PRIORITY")
	private int priority;// 优先级
	@Column(name = "SEVERITY", length = 32)
	private String severity;// 安全级别
	@Column(name = "TITLE", length = 256)
	private String title;// 标题
	@Column(name = "CREATE_DATE")
	private Date createDate;// 创建日期
	@Column(name = "MACHINE_NAME", length = 32)
	private String machineName;// 机器名称
	@Column(name = "APP_DOMAIN_NAME", length = 512)
	private String appDomainName;// 应用程序名称
	@Column(name = "PROCESS_ID", length = 256)
	private String processId;// 进程ID
	@Column(name = "PROCESS_NAME", length = 512)
	private String processName;// 进程名
	@Column(name = "THREAD_NAME", length = 512)
	private String threadName;// 线程名
	@Column(name = "WIN32_THREAD_ID", length = 128)
	private String win32threadid;// win32线程ID
	@Column(name = "MESSAGE", length = 4000)
	private String message; // 日志信息
	@Column(name = "FORMATTED_MESSAGE", length = 4000)
	private String formattedMessage;// 格式化日志信息
	@Column(name = "SUB_SYS_ID", length = 36)
	private String subSysId;// 子系统ID
	@Column(name = "LOG_USER_ID", length = 10)
	private String logUserId;// 日志用户ID
	@Column(name = "LOG_USER_NAME", length = 50)
	private String logUserName;// 日志用户姓名
	@Column(name = "URL", length = 20)
	private String url;// varchar2(20)请求URL

	public String getLogId() {
		return logId;
	}

	public void setLogId(String logId) {
		this.logId = logId;
	}

	public String getApplicationId() {
		return applicationId;
	}

	public void setApplicationId(String applicationId) {
		this.applicationId = applicationId;
	}

	public int getPriority() {
		return priority;
	}

	public void setPriority(int priority) {
		this.priority = priority;
	}

	public String getSeverity() {
		return severity;
	}

	public void setSeverity(String severity) {
		this.severity = severity;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public String getMachineName() {
		return machineName;
	}

	public void setMachineName(String machineName) {
		this.machineName = machineName;
	}

	public String getAppDomainName() {
		return appDomainName;
	}

	public void setAppDomainName(String appDomainName) {
		this.appDomainName = appDomainName;
	}

	public String getProcessId() {
		return processId;
	}

	public void setProcessId(String processId) {
		this.processId = processId;
	}

	public String getProcessName() {
		return processName;
	}

	public void setProcessName(String processName) {
		this.processName = processName;
	}

	public String getThreadName() {
		return threadName;
	}

	public void setThreadName(String threadName) {
		this.threadName = threadName;
	}

	public String getWin32threadid() {
		return win32threadid;
	}

	public void setWin32threadid(String win32threadid) {
		this.win32threadid = win32threadid;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public String getFormattedMessage() {
		return formattedMessage;
	}

	public void setFormattedMessage(String formattedMessage) {
		this.formattedMessage = formattedMessage;
	}

	public String getSubSysId() {
		return subSysId;
	}

	public void setSubSysId(String subSysId) {
		this.subSysId = subSysId;
	}

	public String getLogUserId() {
		return logUserId;
	}

	public void setLogUserId(String logUserId) {
		this.logUserId = logUserId;
	}

	public String getLogUserName() {
		return logUserName;
	}

	public void setLogUserName(String logUserName) {
		this.logUserName = logUserName;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}
	
	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	}

}
